/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.myapp.struts.prepare;

import java.sql.ResultSet;
import java.util.Vector;
import com.myapp.struts.beans.*;

/**
 *
 * @author pavan
 */
public class PrepareUom {

    private Vector vec;

    public PrepareUom() {
        vec = new Vector();
    }

    public Vector prepareUomList(ResultSet rs) {
        try {
            if (rs == null) {
            } // end of if
            else {
                while (rs.next()) {
                    UomBean pb = new UomBean();
                    pb.setUom(rs.getString(1));
                    vec.add(pb);
                }                 // end of while
            }                     // end of else
        } // end of try
        catch (Exception e) {
            System.out.println("exception at Prepare Menu Items" + e);
        }                         // end of catch

        return vec;
    }

    public Vector prepareRows(ResultSet rs) {
        try {
            if (rs == null) {
            } // end of if
            else {
                while (rs.next()) {
                    UomBean pb = new UomBean();
                    pb.setUom(rs.getString(1));
                    pb.setDescription(rs.getString(2));
                    vec.add(pb);
                }                 // end of while
            }                     // end of else
        } // end of try
        catch (Exception e) {
            System.out.println("exception at Prepare Menu Items" + e);
        }                         // end of catch

        return vec;
    }
}
